<?php

require_once 'SmartL/Application/Plugin/Abstract.php';

class BookWorm_Plugin extends SmartL_Application_Plugin_Abstract 
{
	public function preSetUpUserPreferences()
	{
		$application = SmartL_Application::getInstance();
		$template = Zend_Controller_Front::getInstance()->getRequest()->getParam('templateId');
		$template = ucfirst($template);
		$templates = $application->getTemplates(); 
		
		if ( isset($templates[$template]) ) {
			$application->setActualTemplate($template);
		}
	}
}